package org.eclipselabs.egf.portfolio.task.scala.test.integer

import org.eclipse.core.runtime.IProgressMonitor
import org.eclipse.egf.core.EGFCorePlugin
import org.eclipse.egf.core.producer.InvocationException
import org.eclipse.egf.ftask.producer.context.ITaskProductionContext
import org.eclipse.egf.ftask.producer.invocation.ITaskProduction

class IntegerEquals extends ITaskProduction{
	
	def preExecute(taskProductionContext:ITaskProductionContext , monitor:IProgressMonitor ) ={
	}
	
	def doExecute(taskProductionContext:ITaskProductionContext , monitor:IProgressMonitor )={
		var a = taskProductionContext.getInputValue("inA", classOf[Integer])
		var b = taskProductionContext.getInputValue("inB", classOf[Integer])
		var c = taskProductionContext.getInputValue("inC", classOf[Integer])
		var d = taskProductionContext.getInputValue("inD", classOf[Integer])
		var e = taskProductionContext.getInputValue("inE", classOf[Integer])
		var f = taskProductionContext.getInputValue("inF", classOf[Integer])
		if(a == 1 && b == 3 && c == 5 && d == 8 && e == 13 && f == 40)
			EGFCorePlugin.getDefault().logWarning("Test Passed")
		else
			EGFCorePlugin.getDefault().logError("Test Failed")
	}
	
	def postExecute(taskProductionContext:ITaskProductionContext , monitor:IProgressMonitor )={
	}
}